package cn.zdm.authserver.config.mvc;

import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * copyright (C), 2021, 北京同创永益科技发展有限公司
 *
 * @author ZhaoDeman
 * @version 1.0.0
 * <author>                <time>                  <version>                   <description>
 * ZhaoDeman        2021/1/5 15:58                 1.0
 * @program auth-server
 * @description
 * @create 2021/1/5 15:58
 */
public class SpringWebMvcConfig extends WebMvcConfigurationSupport {

    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {

        registry.addResourceHandler("/**").addResourceLocations("classpath:/");

        /**swagger配置 */
        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
        registry.addResourceHandler("/doc.html").addResourceLocations("classpath:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");

        super.addResourceHandlers(registry);
    }
}
